package com.zhq.service;

import com.zhq.dao.BaseAdminDao;
import com.zhq.dao.imp.AdminDaoMysql;

import java.util.Date;

/**
 * @Author:钟豪强
 * @Description:    管理员登录注册
 * @Date Created in  2020-08-14 14:12
 * @Modified By:
 */
public class AdminService {
    private static BaseAdminDao dao = new AdminDaoMysql();

    public static void updateLoginTime(String username, Date date, String ip){
        dao.updateLoginTime(username,date,ip);
    }

    public static boolean login(String username, String ip){
        return dao.login(username,ip);
    }

    /**
     * 管理员根据账号密码登录
     * @param username  用户名(账户)
     * @return  登录结果,true代表登录成功,false代表失败
     */
    public static boolean find(String username){
        return dao.find(username);
    }
}
